template(name='viewTopic')

	.ui-module

		with topic

			.ui-flex-column.ui-flex-center--child

				.ui-flex-column.ui-pdtb-md(style='padding-bottom: 0;')
					h3 {{title}}
					p.ui-padded(style='padding: 16px 64px 0 64px;;') {{desc}}

				.ui-flex-row.ui-flex-center--child

					.ui-flex-1x.ui-padded-md
						span {{left}}

					.ui-padded-md
						if user.profile.avatarUrl
							img.ui-image-circle.ui-image-avatar(src='{{user.profile.avatarUrl}}' style='width: 80px; height: 80px;')
						else
							canvas(width='80' height='80' data-jdenticon-hash='{{user.profile.avatarHash}}')

					.ui-flex-1x.ui-padded-md
						span {{right}}

				.ui-flex-row.ui-flex-center--child

					.ui-flex-1x.ui-padded-md

					.ui-flex-row.ui-flex-1x.ui-flex-center--child

						.ui-flex-1x.ui-padded 点赞

						.ui-flex-1x.ui-padded 收藏

					.ui-flex-row.ui-flex-1x.ui-flex-right-center--child

						.ui-flex-1x.ui-padded 内容不适

		progress(value='{{rbRatio}}' max='1')

		.ui-flex-row

			.ui-flex-1x.ui-flex-left-center--child
				.ui-flex-1x.ui-padded-sm {{topic.stats.left}}

			.ui-flex-1x.ui-flex-right-center--child
				.ui-flex-1x.ui-padded-sm {{topic.stats.right}}

		if currentUser

			.ui-flex-row

				.ui-flex-1x

					with topic

						form.ui-padded.ui-bordered-bottom#leftForm
							textarea.leftContent(rows='3' placeholder='红色阵营' required)
							.ui-padded-sm
								input(type='submit' value='提交')

				.ui-flex-1x

					with topic

						form.ui-padded.ui-bordered-bottom#rightForm
							textarea.rightContent(rows='3' placeholder='蓝色阵营' required)
							.ui-padded-sm
								input(type='submit' value='提交')

		else

			.ui-flex-row.ui-flex-center--child

				.ui-flex-1x.ui-padded-md

					h3
						a(href='{{pathFor route="signin"}}') 登录以后可以进行讨论

		.ui-flex-row

			.ui-flex-column.ui-flex-1x

				each commentsLeft

					+commentItem

			.ui-flex-column.ui-flex-1x

				each commentsRight

					+commentItem
